package com.example.quartz.job;

import com.example.douyin.controller.AuthorizationController;
import com.example.quartz.util.SpringBeanFactory;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author dangwen1
 * @date 2022年01月20日 10:43
 * @description
 */
public class DemoJob extends QuartzJobBean {
    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println("QuartzJob1----" + sdf.format(new Date()));
        AuthorizationController controller = SpringBeanFactory.getBean(AuthorizationController.class);
        String s = controller.loginTest();
        System.out.println(s);
    }
}
